package com.Homework.test;

import java.util.ArrayList;

public class ProvinceSort {
    public int[] Pronvincesort(ArrayList<Yq> yq)
    {
        int flag4 = 0;
        int SumNum1[] = new int[1000];
        //省份排序。
        for(int i = 0, j = 0;i <yq.size() && i+1 < yq.size();i++)
        {   SumNum1[j] = yq.get(i).SumNum;
            if(yq.get(i).SumNum!=yq.get(i+1).SumNum) {
                j++;
                flag4 = j+1;
            }
        }
        for(int i = 0; i < flag4; i++)
        {
            int temp1;
            for(int j = 0 ;j <flag4 - i;j++)
            {
                if(SumNum1[j] < SumNum1[j+1])
                {
                    temp1 = SumNum1[j];
                    SumNum1[j] = SumNum1[j + 1];
                    SumNum1[j+1] = temp1;
                }
            }
        }
        return SumNum1;
    }
}

